/**
 * 
 */
package com.alibaba.middleware.hsf.guide.server.dao.jdbc;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.alibaba.middleware.hsf.guide.api.model.OrderModel;

/**
 * @author weipeng2k 2015年9月23日 下午7:11:25
 */
public class OrderRowMapper implements RowMapper<OrderModel> {
    
    @Override
    public OrderModel mapRow(ResultSet rs, int num) throws SQLException {
        OrderModel orderModel = new OrderModel();
        orderModel.setId(rs.getLong("ID"));
        orderModel.setBuyerMemberId(rs.getString("BUYER_MEMBER_ID"));
        orderModel.setSellerMemberId(rs.getString("SELLER_MEMBER_ID"));
        orderModel.setGmtCreate(rs.getDate("GMT_CREATE"));
        orderModel.setGmtModified(rs.getDate("GMT_MODIFIED"));
        orderModel.setDiscount(rs.getLong("DISCOUNT"));
        orderModel.setProductName(rs.getString("PRODUCT_NAME"));
        orderModel.setRealPayment(rs.getLong("REAL_PAYMENT"));
        orderModel.setTotalPayment(rs.getLong("TOTAL_PAYMENT"));
        
        return orderModel;
    }
    
}
